//处理点击事件的延时问题
var scriptCom = document.createElement("script");
scriptCom.src = 'js/fastclick.js';
document.getElementsByTagName("head")[0].appendChild(scriptCom);
document.addEventListener('DOMContentLoaded', function() {
    setTimeout(function() {
        FastClick.attach(document.body);
    }, 200);
}, false);


//验证手机号正则
var _checkMobile = function(sMobile) {
<<<<<<< HEAD
	if (!(/^1[3|4|5|6|7|8|9][0-9]\d{8}$/.test(sMobile))) {
		return false;
	} else {
		return true;
	}
}
//判断输入的是小数或整数
var _ifNum = function(val, type) {
	// 返回true:满足   false:不满足
	// type:int/float
	if (!parseFloat(val)) {
		return false;
	}
	var str = String(val);
	var point = 0;
	var off = true;
	for (var i = 0; i < str.length; i++) {
		if (isNaN(Number(str[i]))) {
			//不是数字
			if (str[i] == '.') {
				point++;
			} else {
				off = false;
				break;
			}
		}
	}
	if (type == 'int') {
		(off && !point) ? '' : off = false;
	}
	if (type == 'float') {
		(off && point <= 1 && str[str.length - 1] != '.' && str[0] != '.') ? '' : off = false;
	}
	return off;
};
//转换时间戳
var _date = function(timestamp) {
	if (!timestamp) {
		return "";
	}
	var date;
	//时间戳为10位需*1000，时间戳为13位的话不需乘1000
	if (String(timestamp).length == 10) {
		date = new Date(Number(timestamp) * 1000);
	}
	if (String(timestamp).length == 13) {
		date = new Date(Number(timestamp));
	}
	var Y = date.getFullYear() + "-";
	var M =
		(date.getMonth() + 1 < 10 ?
			"0" + (date.getMonth() + 1) :
			date.getMonth() + 1) + "-";
	var D = date.getDate() + " ";
	var h = date.getHours() + ":";
	if (date.getHours() < 10) {
		h = '0' + date.getHours() + ":";
	}
	var m = date.getMinutes() + ":";
	if (date.getMinutes() < 10) {
		m = '0' + date.getMinutes() + ":";
	}
	var s = date.getSeconds();
	if (date.getSeconds() < 10) {
		s = '0' + date.getSeconds();
	}
	return Y + M + D + h + m + s;
}

//钱分转换为元
var _money = function(val) {
	var judge = String(val);
	if (judge == "undefined" || judge == "null") {
		return 0.0;
	}
	var priceStr = String(parseFloat(parseInt(val) / 100));
	var index = priceStr.indexOf(".");
	if (index != -1) {
		var handle = priceStr.slice(index + 1);
		if (handle.length == 1) {
			priceStr = priceStr + "0";
		}
	} else {
		priceStr = priceStr + ".00";
	}
	return priceStr;
}
/*
	content:密码错误(提示内容)
	position:center(提示的垂直位置)
*/
var _toast = function(content, position) {
	if (!position) {
		position = 'center';
	}
	plus.nativeUI.toast(content, {
		verticalAlign: position
	});
=======
    if (!(/^1[3|4|5|6|7|8|9][0-9]\d{8}$/.test(sMobile))) {
        return false;
    } else {
        return true;
    }
}

//转换时间戳
var _date = function(timestamp) {
    if (!timestamp) {
        return "";
    }
    var date;
    //时间戳为10位需*1000，时间戳为13位的话不需乘1000
    if (String(timestamp).length == 10) {
        date = new Date(Number(timestamp) * 1000);
    }
    if (String(timestamp).length == 13) {
        date = new Date(Number(timestamp));
    }
    var Y = date.getFullYear() + "-";
    var M =
        (date.getMonth() + 1 < 10 ?
            "0" + (date.getMonth() + 1) :
            date.getMonth() + 1) + "-";
    var D = date.getDate() + " ";
    var h = date.getHours() + ":";
    if (date.getHours() < 10) {
        h = '0' + date.getHours() + ":";
    }
    var m = date.getMinutes() + ":";
    if (date.getMinutes() < 10) {
        m = '0' + date.getMinutes() + ":";
    }
    var s = date.getSeconds();
    if (date.getSeconds() < 10) {
        s = '0' + date.getSeconds();
    }
    return Y + M + D + h + m + s;
}

//处理底部浮动
var _handBottom = function(el) {
	var h = document.body.scrollHeight;
	window.onresize = function() {
		if(h!=document.body.scrollHeight) {
			el.style.display = 'none';
		} else {
			el.style.display = 'block';
		}
	};
};

//钱分转换为元
var _money = function(val) {
        var judge = String(val);
        if (judge == "undefined" || judge == "null") {
            return 0.0;
        }
        var priceStr = String(parseFloat(parseInt(val) / 100));
        var index = priceStr.indexOf(".");
        if (index != -1) {
            var handle = priceStr.slice(index + 1);
            if (handle.length == 1) {
                priceStr = priceStr + "0";
            }
        } else {
            priceStr = priceStr + ".00";
        }
        return priceStr;
    }
    /*
    	content:密码错误(提示内容)
    	position:center(提示的垂直位置)
    */
var _toast = function(content, position) {
    if (!position) {
        position = 'center';
    }
    plus.nativeUI.toast(content, {
        verticalAlign: position
    });
>>>>>>> parent of 9ade4b9... 你们
}

// 复制到剪贴板
var _copy = function(text) {
<<<<<<< HEAD
	var osName = plus.os.name;
	if (plus.os.name == "Android") {
		var Context = plus.android.importClass("android.content.Context");
		var main = plus.android.runtimeMainActivity();
		var clip = main.getSystemService(Context.CLIPBOARD_SERVICE);
		plus.android.invoke(clip, "setText", text);
	} else if (osName == "iOS") {
		var UIPasteboard = plus.ios.importClass("UIPasteboard");
		var generalPasteboard = UIPasteboard.generalPasteboard();
		// 设置/获取文本内容:
		generalPasteboard.setValueforPasteboardType(text, "public.utf8-plain-text");
	}
=======
    var osName = plus.os.name;
    if (plus.os.name == "Android") {
        var Context = plus.android.importClass("android.content.Context");
        var main = plus.android.runtimeMainActivity();
        var clip = main.getSystemService(Context.CLIPBOARD_SERVICE);
        plus.android.invoke(clip, "setText", text);
    } else if (osName == "iOS") {
        var UIPasteboard = plus.ios.importClass("UIPasteboard");
        var generalPasteboard = UIPasteboard.generalPasteboard();
        // 设置/获取文本内容:
        generalPasteboard.setValueforPasteboardType(text, "public.utf8-plain-text");
    }
>>>>>>> parent of 9ade4b9... 你们
};

//除法
var _accDiv = function(arg1, arg2) {
<<<<<<< HEAD
	var t1 = 0,
		t2 = 0,
		r1, r2;
	try {
		t1 = arg1.toString().split(".")[1].length
	} catch (e) {}
	try {
		t2 = arg2.toString().split(".")[1].length
	} catch (e) {}
	with(Math) {
		r1 = Number(arg1.toString().replace(".", ""))
		r2 = Number(arg2.toString().replace(".", ""))
		return (r1 / r2) * pow(10, t2 - t1);
	}
=======
    var t1 = 0,
        t2 = 0,
        r1, r2;
    try { t1 = arg1.toString().split(".")[1].length } catch (e) {}
    try { t2 = arg2.toString().split(".")[1].length } catch (e) {}
    with(Math) {
        r1 = Number(arg1.toString().replace(".", ""))
        r2 = Number(arg2.toString().replace(".", ""))
        return (r1 / r2) * pow(10, t2 - t1);
    }
>>>>>>> parent of 9ade4b9... 你们
};

//乘法
var _accMul = function(arg1, arg2) {
<<<<<<< HEAD
	var m = 0,
		s1 = arg1.toString(),
		s2 = arg2.toString();
	try {
		m += s1.split(".")[1].length
	} catch (e) {}
	try {
		m += s2.split(".")[1].length
	} catch (e) {}
	return Number(s1.replace(".", "")) * Number(s2.replace(".", "")) / Math.pow(10, m)
=======
    var m = 0,
        s1 = arg1.toString(),
        s2 = arg2.toString();
    try { m += s1.split(".")[1].length } catch (e) {}
    try { m += s2.split(".")[1].length } catch (e) {}
    return Number(s1.replace(".", "")) * Number(s2.replace(".", "")) / Math.pow(10, m)
>>>>>>> parent of 9ade4b9... 你们
};

//截取6位
var _toFixed = function(str1, num) {
    var str = String(str1);

<<<<<<< HEAD
	function hanZeo(z) {
		var zeo = '';
		for (var i = 0; i < z; i++) {
			zeo += '0';
		}
		return zeo;
	}
	var arr = str.split('.');
	if (arr[1]) {
		if (arr[1].length >= num) {
			return arr[0] + '.' + arr[1].slice(0, num);
		} else {
			return arr[0] + '.' + arr[1] + hanZeo(num - arr[1].length);
		}
	} else {
		return str + '.' + hanZeo(num);
	}
}

//关闭除index的其他页面
var _clsoeOther = function() {
	function plusReady() {
		var index = plus.webview.getWebviewById('index');
		if (!index) {
			index = _openHref('index.html', 'index', 'none');
		}
		var all = plus.webview.all();
		var indexUrl = index.getURL();
		for (var i = 0; i < all.length; i++) {
			if (all[i].getURL() != indexUrl) {
				all[i].hide();
			}
		}
		setTimeout(function() {
			for (var i = 0; i < all.length; i++) {
				if (all[i].getURL() != indexUrl) {
					all[i].close('none');
				}
			}
		}, 1500);
	}
	// 判断扩展API是否准备，否则监听'plusready'事件
	if (window.plus) {
		plusReady();
	} else {
		document.addEventListener('plusready', plusReady, false);
	}
};


var _post = function(json) {
	console.log('url++++++' + json.url);
	console.log('post参数+++++++++');
	console.log(JSON.stringify(json.data));
	var obj = new XMLHttpRequest();
	obj.open('post', url, true);
	obj.onreadystatechange = function() {
		if (obj.readyState == 4 && obj.status == 200 || obj.status == 304) {
			// var ret = JSON.parse(obj.responseText);
			console.log("post返回的结果++++++" + obj.responseText);
			json.success(ret);
		}
	};
	obj.send(JSON.stringify(json.data));
};
//乘法
var _accMul = function(arg1, arg2) {
	var m = 0,
		s1 = arg1.toString(),
		s2 = arg2.toString();
	try {
		m += s1.split(".")[1].length
	} catch (e) {}
	try {
		m += s2.split(".")[1].length
	} catch (e) {}
	return Number(s1.replace(".", "")) * Number(s2.replace(".", "")) / Math.pow(10, m)
};
//打开页面
var _openHref = function(json) {
	var animate = json.animate ? json.animate : 'slide-in-right';
	var op = {
		// 'backButtonAutoControl': 'close', 
		// 'animationOptimization': 'none', //不优化
	};
	if (plus.os.name.toLowerCase() == 'android' && parseFloat(plus.os.version) < 6) {
		op.hardwareAccelerated = json.spe ? json.spe : false;
	}
	var web = plus.webview.getWebviewById(json.id);
	if (web) {
		web.show();
	} else {
		app.$data.jiazai = true;
		web = plus.webview.create(json.url, json.id, op);
		web.addEventListener("loaded", function() {
			setTimeout(function() {
				app.$data.jiazai = false;
				web.show(animate);
			}, 200);
		}, false);
	}
	return web;
=======
    function hanZeo(z) {
        var zeo = '';
        for (var i = 0; i < z; i++) {
            zeo += '0';
        }
        return zeo;
    }
    var arr = str.split('.');
    if (arr[1]) {
        if (arr[1].length >= num) {
            return arr[0] + '.' + arr[1].slice(0, num);
        } else {
            return arr[0] + '.' + arr[1] + hanZeo(num - arr[1].length);
        }
    } else {
        return str + '.' + hanZeo(num);
    }
}

//关闭自己
var _closeCurrent = function() {
    var web = plus.webview.currentWebview();
    setTimeout(function() {
        web.hide();
        web.close('none');
    }, 1500);
};
//关闭除index的其他页面
var _clsoeOther = function() {
    function plusReady() {
        var index = plus.webview.getWebviewById('index');
        if (!index) {
            index = _openHref('index.html', 'index', 'none');
        }
        var all = plus.webview.all();
        var indexUrl = index.getURL();
        for (var i = 0; i < all.length; i++) {
            if (all[i].getURL() != indexUrl) {
                all[i].hide();
            }
        }
        setTimeout(function() {
            for (var i = 0; i < all.length; i++) {
                if (all[i].getURL() != indexUrl) {
                    all[i].close('none');
                }
            }
        }, 1500);
    }
    // 判断扩展API是否准备，否则监听'plusready'事件
    if (window.plus) {
        plusReady();
    } else {
        document.addEventListener('plusready', plusReady, false);
    }
};

var _bas64Post = function(url, json, cal) {
    function handleBase64(data) {
        var base = new Base64();
        var list = {};
        for (var key in data) {
            var val = null;
            if (typeof data[key] == 'object' || typeof data[key] == 'number') {
                val = JSON.stringify(data[key]);
            } else {
                val = data[key];
            }
            list[base.encode(key)] = base.encode(val);
        }
        return list;
    }
    _post(url, handleBase64(json), cal);
};

var _basJie = function(val) {
    var base = new Base64();
    var json = {};
    for (key in val) {
        var key1 = base.decode(key);
        if (key1 == 'mnemonic') {
            var arr = val[key];
            var arrC = [];
            for (var i = 0; i < arr.length; i++) {
                arrC.push(base.decode(arr[i]));
            }
            json.mnemonic = arrC;
        } else {
            json[key1] = base.decode(val[key]);
        }
    }
    return json;
};

var _post = function(url, json, cal) {
    console.log('url++++++' + url);
    console.log('post参数+++++++++');
    console.log(JSON.stringify(json));
    var obj = new XMLHttpRequest();
    obj.open('post', url, true);
    obj.onreadystatechange = function() {
        if (obj.readyState == 4 && obj.status == 200 || obj.status == 304) {
            var ret = JSON.parse(obj.responseText);
            console.log('post返回的结果++++++');
            console.log(JSON.stringify(ret));
            cal(ret);
        }
    };
    obj.send(JSON.stringify(json));
};
//乘法
var _accMul = function(arg1, arg2) {
    var m = 0,
        s1 = arg1.toString(),
        s2 = arg2.toString();
    try { m += s1.split(".")[1].length } catch (e) {}
    try { m += s2.split(".")[1].length } catch (e) {}
    return Number(s1.replace(".", "")) * Number(s2.replace(".", "")) / Math.pow(10, m)
};
//打开页面
var _openHref = function(url, id, animate, spe) {
    animate = animate ? animate : 'slide-in-right';
    var op = {
        statusbar: {
            background: '#E6E6E6'
        }
    };
    if (plus.os.name.toLowerCase() == 'android' && parseFloat(plus.os.version) < 6) {
        op.hardwareAccelerated = spe ? spe : false;
    }
    var web = plus.webview.getWebviewById(id);
    if (web) {
        web.show();
    } else {
        app.$data.jiazai = true;
        web = plus.webview.create(url, id, op);
        web.addEventListener("loaded", function() {
            setTimeout(function() {
                app.$data.jiazai = false;
                web.show(animate);
            }, 200);
        }, false);
    }
    return web;
>>>>>>> parent of 9ade4b9... 你们
};

//域名  正式
<<<<<<< HEAD
var HTTP = 'http://127.0.0.1:9001';

=======
var HTTP = 'http://sa.8kpay.com';
var HTTPUP = 'http://su.8kpay.com';
<<<<<<< HEAD
>>>>>>> 8b04caa87765aef53492c5ed729371362bed1d15
=======


//测试
// var HTTP = 'http://testsuper.8kpay.com';
// var HTTPUP = HTTP;


//客服
var SERVICEQQ = '614085089';

//请求给后台 不知道什么鬼接口
var UPDATA_TIME = HTTP + '/index.php/Appindex/upaddtime';

//拿手机区号
var GET_COUNTRY=HTTP+'/index.php/Appindex/get_country';

//注册接口1
var post_regi1 = HTTP + '/index.php/Appindex/register';

//注册接口2
var post_regi2 = HTTP + '/index.php/Appindex/register2';

//发送验证码
var SEND_CODE = HTTP + '/index.php/Appindex/register_send_sms';

//登陆接口
var LOGIN = HTTP + '/index.php/Appindex/login';

//忘记密码1
var FORGET_PASSWORD = HTTP + '/index.php/Appindex/forget_pwd1';

//忘记密码1
var FORGET_PASSWORD2 = HTTP + '/index.php/Appindex/forget_pwd2';

//主页数据
var INDEX = HTTP + '/index.php/Appindex/header_index';

//币种详情
var COINS_VIEW = HTTP + '/index.php/Appindex/coins_view';

//转出页
var TRANSFER = HTTP + '/index.php/Appindex/transfer';

//添加地址的 拉取币种列表
var TRANSFER_ADD_VIEW = HTTP + '/index.php/Appindex/transfer_add_view';

//提交的时候拉取接口 通知后台存地址
var HAVA_ADDRESS = HTTP + '/index.php/Appindex/have_address';

//转出提交
var TRANSFER_TO = HTTP + '/index.php/Appindex/transfer_to';

//添加转出地址
var TRANSFER_ADD = HTTP + '/index.php/Appindex/transfer_add';

//转出地址列表
var TRANSFER_ADDRESS = HTTP + '/index.php/Appindex/transfer_address';

//删除地址
var TRANSFER_DEL = HTTP + '/index.php/Appindex/transfer_del';

//免手续费的转账
var NO_OTH_TRANS=HTTP+'/index.php/aidog/interturn';

//行情页
var MARKET = HTTP + '/index.php/Appindex/market';

//闪兑  兑换接口
var FLICKER = HTTP + '/index.php/Appindex/flicker';

//兑换记录
var FLICKER_LIST = HTTP + '/index.php/Appindex/flicker_list';

//智能狗列表
//var ZINENGGOU = HTTP + '/index.php/Appindex/znengdog';
var ZINENGGOU = HTTP + '/index.php/aidog/new_znengdog';

//开启智能狗
//var ZINEGNGOU_OPEN = HTTP + '/index.php/Appindex/znengdog_open';
var ZINEGNGOU_OPEN = HTTP + '/index.php/aidog/znengdog_newopen';

//关闭智能狗
//var ZNG_CLOSE = HTTP + '/index.php/Appindex/znengdog_close';
var ZNG_CLOSE = HTTP + '/index.php/aidog/znengdog_newclose';

//智能狗开启的记录
var ZINEGGOU_OPENLIST = HTTP + '/index.php/Appindex/znengdog_openlist';

//智能狗收益列表
var DOG_PROFIT_DETAIL = HTTP + '/index.php/Appindex/znengdog_profit';

//导出私钥
var ZEXPORRTKEY = HTTP + '/index.php/Appindex/exportkey';

var ZEXPORRTKEY2 = HTTP + '/index.php/Appindex/exportkey2';


//公告列表
var NOTICE = HTTP + '/index.php/Appindex/notice';

//应用数据
var APPLY = HTTP + '/index.php/Appindex/apply';

//糖果派送数据
var SUGER_DISPATCH = HTTP + '/index.php/Appindex/suger_dispatch';

//智能高管收益
var MONEY_INCOME = HTTP + '/index.php/Appindex/money_income';

//账单记录
var USER_TR = HTTP + '/index.php/Appindex/user_tr';

//版本升级
var UPDATE = HTTPUP + '/index.php/Appindex/game_update';

//修改交易密码
var UPDATE_TRANS_PASS = HTTP + '/index.php/Appindex/upd_pwd';

//更多智能狗信息
//var MORE_ZINENG_INFO = HTTP + '/index.php/Appindex/znengdog_view';
var MORE_ZINENG_INFO = HTTP + '/index.php/aidog/znengdog_newview';

//修改头像
var EDIT_AVA = HTTP + '/index.php/Appindex/headpic';

//闪兑详情
var FLICKER_VIEW = HTTP + '/index.php/Appindex/flicker_view';

//判断是否被封号
var IS_FRO = HTTP + '/index.php/Appindex/is_frozen';

//拿到团队的数据
//var GROUP_DATA = HTTP + '/index.php/Appindex/get_group';
var GROUP_DATA = HTTP + '/index.php/aidog/get_newgroup';

//财务明细数据
//var ALL_TRANS = HTTP + '/index.php/Appindex/user_profit';
var ALL_TRANS = HTTP + '/index.php/aidog/user_newprofit';

//私募数据
var SI_MU = HTTP + '/index.php/Simu/index';

//私募关闭与否
var SIMU_OFF = HTTP + '/index.php/Simu/is_open_simu';

//参与私募
var GO_SIMU = HTTP + '/index.php/Simu/purchase';

//拿地址，给游戏做准备 
var GAME_ADDRESS = HTTP + '/index.php/Appindex/have_address';

//session发送短信
var SESSION_DUAN = HTTP + '/index.php/Appindex/session_send';

//社区下拉框
var GROUP_SELECT=HTTP+'/index.php/aidog/get_effective';
>>>>>>> parent of 9ade4b9... 你们
